<!--{template header}-->
<div  class="container">
<div id="main">

    <div class="oauth login-and-register-container">

      <div class="page-header">
        <div class="pull-right">或 <a href="index.php?do=oauthlogin&type={$type}">绑定已有帐号</a></div>
        <h1>完善个人信息</h1>
      </div>

     <form role="form" action="index.php?do=oauthregister&type={$type}"  class="form-horizontal" name="OauthregisterForm" id="OauthregisterForm" method="post">
      <input type="hidden" name="formhash" id="formhash" value="{FORMHASH}">
		<input type="hidden" name="is_login"  id="is_login"  value="1" />
      <div class="form-group">
        <label for="" class="control-label col-xs-3"><img src="static/img/oauth2.0/32/{$type}.png" alt="{$arrOauthType[$type]}帐号"> {$arrOauthType[$type]}帐号</label>
        <div class="col-xs-7">
          <p class="form-control-static">{$arrOauthInfo['nickname']}</p>
        </div>
      </div>

      <div class="form-group">
        <label for="account" class="control-label col-xs-3">用户名</label>
        <div class="col-xs-5">
          <input type="text" class="form-control" id="account" name="account" value="{$arrOauthInfo['nickname']}" placeholder="请输入登录帐号">
        </div>
      </div>
      <hr/>
      <div class="form-group">
        <label for="email" class="control-label col-xs-3"></label>
        <div class="col-xs-7 form-control-static">
          <span class="control-label-span">(填写后将可以直接通过账号密码登录)</span>
          <span class="control-label-text">
            <a href="index.php?do=oauthlogin&type={$type}&is_binding=1">绑定已有帐号</a>
          </span>
        </div>
          
      </div>

      <div class="form-group">
        <label for="email" class="control-label col-xs-3">邮箱</label>
        <div class="col-xs-7">
          <input type="email" class="form-control" name="email" id="email" placeholder="请输电子邮箱">
        </div>
      </div>

      <div class="form-group">
        <label for="password" class="control-label col-xs-3">登录密码</label>
        <div class="col-xs-7">
          <input type="password" class="form-control" name="password" id="password" placeholder="请输入帐号的密码" onKeyup="pwStrength(this.value)">
        </div>
      </div>

      <div class="form-group" id="pwdStrength">
        <div class="col-xs-offset-3 col-xs-7">
          <div class="password_strength">
            <span class="selected">弱</span>
            <span>中</span>
            <span>强</span>
          </div>
        </div>
      </div>


      <div class="form-group">
        <label class="control-label col-xs-3" for="confirmPassword">确认密码</label>
        <div class="col-xs-7">
          <input type="password" class="form-control" name="confirmPassword" id="confirmPassword"  placeholder="确认密码">
        </div>
      </div>

      <div class="form-group">
        <div class="col-xs-offset-3 col-xs-7">
          <div class="checkbox">
            <label>
              <input type="checkbox"  name="agree" id="agree" value="1" checked="checked"> 我同意 <a href="index.php?do=single&id=312" target="_blank">《{$basic_config['website_name']}网站条款》</a>
            </label>
          </div>
        </div>
      </div>

      <div class="form-group">
        <div class="col-md-offset-3 col-xs-7">
          <button type="submit" class="btn btn-primary">提交</button>
        </div>
      </div>

      </form>

    </div><!-- oauth end -->

</div>
</div>
<script type="text/javascript" src="static/js/model/register/register.js"></script>
<script type="text/javascript">
var type="{$type}";
var type="qq";
function checkStrong(sPW){
	//if (sPW.length < 3){
		//Modes=1;
	//}else{
		var pwLength = 	sPW.length;
		  var patEn = /[a-zA-Z]/;
		  var patnum = /[0-9]/;
		  var speChar = /[`~!@#$\^&\*\(\)=\|{}':;',\/\?\[\]\.<>]/;
		  var isEn = patEn.test(sPW);
		  var isNum = patnum.test(sPW);
		  var isSpe = speChar.test(sPW);
		  Modes = getStrong(isEn,isNum,isSpe,pwLength);

	//}
	 return Modes;
}

function getStrong (isEn,isNum,isSpe,pwLength){
	if (isEn && isNum && isSpe && (pwLength>6)){
		var setModes = 3;
	}else{
		var setModes = 2;
		if((isEn && isNum)||(isNum && isSpe)||(isEn&&isSpe)){
			var setModes = 2;
		}else{
			var setModes = 1;
		}
	}
	return setModes;
}

function pwStrength(pwd){
  if (pwd==null||pwd==""){
  	S_level = 0;
  } else{
	  S_level=checkStrong(pwd);
	  $("#pwdStrength span:lt("+S_level+")").addClass('selected');
	  $("#pwdStrength span:gt("+(S_level-1)+")").removeClass('selected');
  }

}
</script>
<!--{template footer}-->
